14. Coprocessor 0

14.20 Performance Counter Registers (25)


The R10000 processor defines two performance counters and two associated control registers, which are mapped into CP0 register 25. An encoding in the MTC0/MFC0 instructions on register 25 indicates which counter or control register is used.

Each counter is a 32-bit read/write register and is incremented by one each time the countable event, specified in its associated control register, occurs. Each counter can independently count one type of event at a time.

The counter asserts an interrupt, IP[7], when its most significant bit (bit 31) becomes one (the counter overflows) and the associated performance control register enables the interrupt.

The counting continues after counter overflow whether or not an interrupt is signalled.

The format of the control registers are shown in Figure 14-22.



Figure 14-22 Control Register Format

The fields of the Control register are:

Table 14-18 Counter Events


Footnote to Table 14-18. (See page 248 in Errata.)




These modes can be set individually; for example, one could set all four bits to count a certain event in all processor modes except during a cache error exception.

The following rules apply:

The performance counters and associated control registers are written by using an MTC0 instruction, as shown in Table 14-19.

Table 14-19 Writing Performance Registers Using MTC0

The performance counters and associated control registers are read by using a MFC0 instruction, as shown in Table 14-20.

Table 14-20 Reading Performance Registers Using MFC0

The format of the performance control registers are shown in Table 14-21.

Table 14-21 Performance Control Register Format

The count enable field specifies whether counting is to be enabled during User, Supervisor, Kernel, and/or Exception level mode. Any combination of count enable bits may be asserted.

All unused bits in the performance control registers are reserved.

All counting is disabled when the ERL bit of the CP0 Status register is asserted.

Table 14-22 defines the operation of the count enable bits of the performance control registers.

Table 14-22 Count Enable Bit Definition

The following rules apply:




Copyright 1995, MIPS Technologies, Inc. -- 29 JAN 96


Generated with CERN WebMaker